import java.util.Arrays;

public class Text3 {
    public int MoreThanHalfNum_Solution (int[] numbers) {
        /*int[] arr = new int[10];

        for (int i=0;i< numbers.length;i++){
            arr[numbers[i]]++;
            if (arr[numbers[i]]>numbers.length/2){
                System.out.println(numbers[i]);
                return numbers[i];
            }
        }*/

        Arrays.sort(numbers);
        if (numbers.length%2!=0){
            return numbers[numbers.length/2+1];
        }
        return numbers[numbers.length/2];
    }
}
